<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

class pqcesViewNuevoac extends JView
{
	function display($tpl = null)
	{
		$model = $this->getModel('nuevoac');
		$fecha	=& $model->getData();
		$isNew	= ($fecha->id < 1);
		$text = $isNew ? JText::_('COM_PQCE_NEWM') : JText::_('COM_PQCE_EDIT');
		JToolBarHelper::title(   JText::_( 'COM_PQCE_EVNT' ).': <small><small>[ ' . $text.' ]</small></small>' );
		JToolBarHelper::apply('applyFact',JText::_( 'COM_PQCE_SAVE' ));
		JToolBarHelper::save('saveFact',JText::_( 'COM_PQCE_SAVEC' ));
		if ($isNew)  {
			JToolBarHelper::cancel('closeFact',JText::_( 'COM_PQCE_CANCEL' ));
		} else {
			JToolBarHelper::cancel( 'closeFact', JText::_( 'COM_PQCE_CLOSE' ) );
		}
		$ftype=-1;
		$f=$fecha->refdate;
		if ($f!='0000-00-00'){
		$ftype = $fecha->type;
		}
		$this->assignRef('tipo',$ftype);
		$this->assignRef('fecha',$fecha);
		$avCat=& $model->getCat();
		$this->assignRef('catego',$avCat);
                $doc = &JFactory::getDocument();
                $doc->addScript(JURI::root()."administrator/components/com_pqce/views/nuevoac/tmpl/submitbutton.js");
		parent::display($tpl);
	}
}
